package day1.array;

import lombok.Data;

import java.util.Objects;

/**
 * @author joker
 * @date 2022/4/11 0011 - 20:35
 */
@Data
public class Student {
    private String name;
    public int age;
    public boolean gender;

    private String as;
    private boolean sa;
    private int anInt;




    public int id=1;
    public String m3(){
        return "a";
    }

    public void m1(){
        System.out.println("stu");
    }
    public void m2(){
        System.out.println("st");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public boolean isGender() {
        return gender;
    }

    public void setGender(boolean gender) {
        this.gender = gender;
    }

    public Student() {
//        this("张三");
        System.out.println("无参");
    }

    public Student(String name) {
        this(12);
        System.out.println("name");
        this.name = name;
    }

    public Student(boolean gender) {
        System.out.println("布尔");
        this.gender = gender;
    }

    public Student(int age) {
        this(true);
        System.out.println("年龄");
        this.age = age;
    }

    public static void main(String[] args) {
        new Student(12);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return age == student.age &&
                gender == student.gender &&
                sa == student.sa &&
                anInt == student.anInt &&
                id == student.id &&
                Objects.equals(name, student.name) &&
                Objects.equals(as, student.as);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, gender, as, sa, anInt, id);
    }
}
